import http from ".."
import { type CustomSuccessData, type LoginStudentResult, type LoginTeacherResult, type LoginTeacherParam, type LoginStudentParam } from "../types"

export const loginStudent= async(loginParam:LoginStudentParam):Promise<CustomSuccessData<LoginStudentResult>>=>{
    const res = await http.reqPost<LoginStudentResult>(
        '/api/students/validate',
        {
            stuId:loginParam.stuId,
            stuPwd:loginParam.stuPwd
        },
    )
    return res
}
export const loginTeacher= async(loginParam:LoginTeacherParam):Promise<CustomSuccessData<LoginTeacherResult>>=>{
    const res = await http.reqPost<LoginTeacherResult>(
        '/api/teachers/login',
        {
            teaId:loginParam.teaId,
            teaPwd:loginParam.teaPwd
        },
    )
    return res
}